using UnityEngine;

namespace MeshCombine
{
	public static class GameObjectExtension
	{
		public static Mesh GetMesh(this GameObject obj)
		{
			Renderer component = obj.GetComponent<Renderer>();
			MeshFilter component2 = obj.GetComponent<MeshFilter>();
			Mesh result = null;
			if ((Object)(object)component2 != (Object)null)
			{
				result = component2.sharedMesh;
			}
			else if (component is SkinnedMeshRenderer)
			{
				SkinnedMeshRenderer val = component as SkinnedMeshRenderer;
				result = val.sharedMesh;
			}
			return result;
		}
	}
}
